# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=libgusb
pkgver=0.4.8
pkgrel=0
pkgdesc="GLib wrapper around libusb"
url="https://github.com/hughsie/libgusb"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	eudev-dev
	glib-dev
	gobject-introspection-dev
	json-glib-dev
	libusb-dev
	meson
	py3-setuptools
	python3-dev
	vala
	"
checkdepends="hwids-usb"
subpackages="$pkgname-dev $pkgname-utils"
source="libgusb-$pkgver.tar.gz::https://github.com/hughsie/libgusb/archive/$pkgver.tar.gz"
options="!check" # libusb needs hardware to run without umockdev

build() {
	abuild-meson \
		-Db_lto=true \
		-Ddocs=false \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

utils() {
	pkgdesc="$pkgdesc (utils)"

	amove usr/bin
}

sha512sums="
c88b407dfb58c8df7a4f7913869388d9065955bce355b5035ef61cc44ee5ef85a102b4018093a3d83b602b82065b8af1022fae74048fd246503ffcd70f2181d9  libgusb-0.4.8.tar.gz
"
